package com.itheima.service.Impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.common.PageBean;
import com.itheima.mapper.OperateLogMapper;
import com.itheima.service.OperateLogService;
import com.itheima.vo.LogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OperateLogServiceImpl implements OperateLogService {

    @Autowired
    OperateLogMapper operateLogMapper;

    @Override
    public PageBean page(Integer page, Integer pagesize) {
        PageHelper.startPage(page, pagesize);
        Page<LogVo> p = operateLogMapper.query();
        return new PageBean(p.getTotal(), p.getResult());
    }
}
